import request from '@/utils/request'
const baseUrl = '/eduservice/course'
export default {
    /**
     * @returns 
     */
     saveEntity(entity) {
        return request({
            url:  baseUrl + `/saveEntity`,
            method: 'post',
            data:{...entity}
        })
    },
    /**
     * 根据id获取实体信息
     * @returns 
     */
     getEntityById(id) {
        return request({
            url:  baseUrl + `/getEntityById/${id}`,
            method: 'get',
        })
    },
     /**
     * 根据id修改实体信息
     * @returns 
     */
      updateEntity(entity) {
        return request({
            url:  baseUrl + `/updateEntity`,
            method: 'put',
            data:{...entity}
        })
    },
    /**
     * 根据id修改实体信息
     * @returns 
     */
     findCoursePublishVoById(id) {
        return request({
            url:  baseUrl + `/findCoursePublishVoById/${id}`,
            method: 'get',
        })
    },

    updateStatusById(id){
        return request({
            url:  baseUrl + `/updateStatusById/${id}`,
            method: 'get',
        })
    },
    listEntity(courseQuery, page, limit ){
        return request({
            url:  baseUrl + `/listEntity/${page}/${limit}`,
            method: 'post',
            data:{...courseQuery}
        })
    },
    deleteEntityById( id ){
        return request({
            url:  baseUrl + `/deleteEntityById/${id}`,
            method: 'delete',
        })
    }
}